import  {createRouter,createWebHistory,createWebHashHistory} from 'vue-router';
import Calculate from '../views/import/Calculate.vue'
import component from 'element-plus/es/components/tree-select/src/tree-select-option.mjs';
import { KeepAlive } from 'vue';

const routes = [
    // {
    //     path: '/',
    //     redirect: '/pw/'
    // },
    {
        path:'/login',
        name: 'login',
        component:()=> import("@/views/root/Login.vue")
    },
    {
        path:'/pw/',
        name:'topolLoadTransferogy',
        component:() => import("@/views/LoadTransfer.vue")
    },
    {
       path: '/',
       redirect: '/login'
    },
    {
        path: '/tj-model',
        name: 'tjModel',
        component:()=> import("@/views/import/Containner.vue")
    }
    ,
    {
        path: '/mainbox',
        name: 'mainbox',
        component:()=>import("@/views/import/Mainbox.vue"),
        children:[
           { path: 'calculate',
             name: 'calculate',
             component:()=> import("@/views/import/Calculate.vue")
           },
           {
             path: 'agent',
             name: 'agent',
             component:()=> import("@/views/agent/Agent.vue")
           }
        ]
    }
    ,
    {
        path: '/performance',
        name: 'performance',
        component:()=>import("@/views/performance/PerformanceMainbox.vue"),
        children:[
            {
                path:'strategy',
                name:'strategy',
                component:()=>import("@/views/performance/Strategy.vue")
            },
            {
                path:'information',
                name:'information',
                component:()=>import("@/views/performance/Information.vue"),
                children:[
                    {
                        path: 'information-table',
                        name: 'informationTable',
                        component:()=>import("@/views/performance/InformationTable.vue")
                    },
                    {
                        path: 'information-dialog',
                        name: 'informationDialog',
                        component:()=>import("@/views/performance/InformationDialog.vue")
                    }
                ]
            },
            {
                path:'robot',
                name:'robot',
                component:()=>import("@/views/performance/Robot.vue")
            }
            
        ]
    }
    ,
    {
        path: '/effect',
        name: 'effect',
        component:()=>import("@/views/effect/EffectMainbox.vue"),
        children:[
            {
              path:'optimaze-ctrl',
              name: 'optimazeCtrl',
              component:()=>import("@/views/effect/OptimazeControll.vue"),
              children:[
                {
                    path:'optimaze-child1',
                    name:'optimazeChild1',
                    component:()=>import("@/views/effect/OptimazeControllChildOne.vue"),
                    meta:{
                        KeepAlive:true
                    }
                },
                {
                    path: 'optimaze-child2',
                    name: 'optimazeChild2',
                    component:()=>import("@/views/effect/OptimazeControllChildTwo.vue")
                },
                {
                    path: 'optimaze-child3',
                    name: 'optimazeChild3',
                    component:()=>import("@/views/effect/OptimazeControllChildThree.vue"),
                    children:[
                        {
                            path: 'information-table/:paramName',
                            name: 'informationTable',
                            component:()=>import("@/views/performance/InformationTable.vue")
                        },
                        {
                            path: 'information-dialog/:paramName',
                            name: 'informationDialog',
                            component:()=>import("@/views/performance/InformationDialog.vue")
                        }
                    ]
                }
              ]
            },
            {
              path:'fault-process',
              name:'faultProcess',
              component:()=>import("@/views/effect/FaultProcess.vue"),
              children:[
                {
                   path: 'fault-child1',
                   name: 'faultChild1',
                   component:()=>import("@/views/effect/FaultChildOne.vue")
                },
                {
                    path: 'fault-child2',
                    name: 'faultChild2',
                    component:()=>import("@/views/effect/FaultChildTwo.vue")
                },
                {
                    path: 'fault-child3',
                    name: 'faultChild3',
                    component:()=>import("@/views/effect/FaultChildThree.vue")
                }
              ]
            }
        ]
    }
    
]

const router = createRouter({
    history:createWebHashHistory(),
    routes,
})

export default  router
